<!-- @format -->

<template>
  <div>
    <ul>
      <li
        v-for="(item, idx) in arr"
        :key="idx">
        {{ item }}
      </li>
    </ul>
    <button @click="insert">插入新来的</button>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        arr: ['老大', '老二', '老三']
      }
    },
    methods: {
      insert() {
        this.arr.splice(1, 0, '新来的')
      }
    }
  }
</script>

<style></style>
